/*
 * @Description: 数组
 * @Author: rendc
 * @Date: 2023-11-18 09:04:05
 * @LastEditors: rendc
 * @LastEditTime: 2023-11-18 10:01:54
 */
import java.util.Arrays;
public class Test2{
  public static void main(String[] args){
    int[] arr1 = new int[2];
    arr1[0] = 1;
    arr1[1] = 2;
    // arr1：[1,2]
    int[] arr2 = new int[2];
    // arr2[0] = 1;
    // arr2[1] = 2;
    // arr2：[1,2]
    // arr1 == arr2 ?
    // System.out.println(arr1); // [I@7852e922
    // System.out.println(arr2); // [I@4e25154f
    // 借助工具类 完成数组拷贝
    System.out.println(arr1.length);
    System.out.println(Arrays.toString(arr1));
    arr1=Arrays.copyOf(arr1,10);
    System.out.println(arr1.length);
    System.out.println(Arrays.toString(arr1));
    Arrays.fill(arr1,100);
    System.out.println(Arrays.toString(arr1));
    // int[] arr3 = {1,3,2,6,5,4};
    // System.out.println(Arrays.toString(arr3));
    // Arrays.sort(arr3);
    // System.out.println(Arrays.toString(arr3));
  }
}